package com.minimalist.common.entity.lindi.po;

import com.minimalist.common.config.mybatis.InsertFullColumnHandler;
import com.minimalist.common.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.common.config.mybatis.bo.BaseEntity;
import com.mybatisflex.annotation.Table;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * 林地指标交易平台_政策法规表 实体类。
 *
 * @author 11987
 * @since 2025-06-12
 */
@Table(value = "LINDI_LAWS", onInsert = InsertFullColumnHandler.class, onUpdate = UpdateFullColumnHandler.class)
public class LindiLaws extends BaseEntity implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 政策法规ID
     */
    private Long lawsId;

    /**
     * 政策法规标题
     */
    private String lawsTitle;

    /**
     * 政策法规内容
     */
    private String lawsContent;

    /**
     * 附件ID，多个使用 , 分割
     */
    private String lawsFileId;

    /**
     * 状态  0禁用 1正常
     */
    private Integer status;

    /**
     * 发布时间
     */
    private LocalDateTime publishTime;

    public LindiLaws(){
    }

    public LindiLaws(Long lawsId, String lawsTitle, String lawsContent, String lawsFileId, Integer status, LocalDateTime publishTime){
        this.lawsId = lawsId;
        this.lawsTitle = lawsTitle;
        this.lawsContent = lawsContent;
        this.lawsFileId = lawsFileId;
        this.status = status;
        this.publishTime = publishTime;
    }

    public Long getLawsId(){
        return lawsId;
    }

    public void setLawsId(Long lawsId){
        this.lawsId = lawsId;
    }

    public String getLawsTitle(){
        return lawsTitle;
    }

    public void setLawsTitle(String lawsTitle){
        this.lawsTitle = lawsTitle;
    }

    public String getLawsContent(){
        return lawsContent;
    }

    public void setLawsContent(String lawsContent){
        this.lawsContent = lawsContent;
    }

    public String getLawsFileId(){
        return lawsFileId;
    }

    public void setLawsFileId(String lawsFileId){
        this.lawsFileId = lawsFileId;
    }

    public Integer getStatus(){
        return status;
    }

    public void setStatus(Integer status){
        this.status = status;
    }

    public LocalDateTime getPublishTime(){
        return publishTime;
    }

    public void setPublishTime(LocalDateTime publishTime){
        this.publishTime = publishTime;
    }

    public static LindiLawsBuilder builder(){
        return new LindiLawsBuilder();
    }

    @Override
    public boolean equals(Object o){
        if (this == o){
            return true;
        }
        if (o == null || getClass() != o.getClass()){
            return false;
        }
        if (!super.equals(o)){
            return false;
        }
        LindiLaws that = (LindiLaws) o;
        return Objects.equals(lawsId, that.lawsId) &&
                Objects.equals(lawsTitle, that.lawsTitle) &&
                Objects.equals(lawsContent, that.lawsContent) &&
                Objects.equals(lawsFileId, that.lawsFileId) &&
                Objects.equals(status, that.status);
    }

    @Override
    public int hashCode(){
        return Objects.hash(super.hashCode(), lawsId, lawsTitle, lawsContent, lawsFileId, status);
    }

    @Override
    public String toString(){
        return "LindiLaws{" +
                "lawsId=" + lawsId +
                ", lawsTitle='" + lawsTitle + '\'' +
                ", lawsContent='" + lawsContent + '\'' +
                ", lawsFileId='" + lawsFileId + '\'' +
                ", status=" + status +
                ", publishTime=" + publishTime +
                "} " + super.toString();
    }

    public static class LindiLawsBuilder{
        private Long lawsId;
        private String lawsTitle;
        private String lawsContent;
        private String lawsFileId;
        private Integer status;
        private LocalDateTime publishTime;

        public LindiLawsBuilder lawsId(Long lawsId){
            this.lawsId = lawsId;
            return this;
        }

        public LindiLawsBuilder lawsTitle(String lawsTitle){
            this.lawsTitle = lawsTitle;
            return this;
        }

        public LindiLawsBuilder lawsContent(String lawsContent){
            this.lawsContent = lawsContent;
            return this;
        }

        public LindiLawsBuilder lawsFileId(String lawsFileId){
            this.lawsFileId = lawsFileId;
            return this;
        }

        public LindiLawsBuilder status(Integer status){
            this.status = status;
            return this;
        }

        public LindiLawsBuilder publishTime(LocalDateTime publishTime){
            this.publishTime = publishTime;
            return this;
        }

        public LindiLaws build(){
            return new LindiLaws(lawsId, lawsTitle, lawsContent, lawsFileId, status, publishTime);
        }
    }

}
